

<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  
  <title>第 4 页 | k1988</title>
  <meta name="author" content="赵海洋">
  
  <meta name="description" content="个人博客">
  
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  
  <meta property="og:site_name" content="k1988"/>

  
    <meta property="og:image" content="undefined"/>
  

  <link href="/favicon.ico" rel="icon" type="image/x-ico">
  <link rel="alternate" href="http://k1988.github.com/rss.xml" title="k1988" type="application/rss+xml">
  <link rel="stylesheet" href="/css/style.css" media="screen" type="text/css">
  <!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  <script src="//libs.baidu.com/jquery/1.8.0/jquery.min.js"></script>
</head>


<body>
  <header id="header" class="inner">
<div class="alignleft">
  <h1><a href="/">k1988</a></h1>
  <h2><a href="/"></a></h2>
</div>
<nav id="main-nav" class="alignright">
  <ul>
    
      <li><a href="/">首页</a></li>
    
      <li><a href="/archives">归档</a></li>
    
      <li><a href="/about">关于</a></li>
    
	<li> <a href="/rss.xml">RSS</a> </li>
<li> <a title="把这个链接拖到你的Chrome收藏夹工具栏中" href='javascript:(function() {
	function c() {
		var e = document.createElement("link");
		e.setAttribute("type", "text/css");
		e.setAttribute("rel", "stylesheet");
		e.setAttribute("href", f);
		e.setAttribute("class", l);
		document.body.appendChild(e)
	}
 
	function h() {
		var e = document.getElementsByClassName(l);
		for (var t = 0; t < e.length; t++) {
			document.body.removeChild(e[t])
		}
	}
 
	function p() {
		var e = document.createElement("div");
		e.setAttribute("class", a);
		document.body.appendChild(e);
		setTimeout(function() {
			document.body.removeChild(e)
		}, 100)
	}
 
	function d(e) {
		return {
			height : e.offsetHeight,
			width : e.offsetWidth
		}
	}
 
	function v(i) {
		var s = d(i);
		return s.height > e && s.height < n && s.width > t && s.width < r
	}
 
	function m(e) {
		var t = e;
		var n = 0;
		while (!!t) {
			n += t.offsetTop;
			t = t.offsetParent
		}
		return n
	}
 
	function g() {
		var e = document.documentElement;
		if (!!window.innerWidth) {
			return window.innerHeight
		} else if (e && !isNaN(e.clientHeight)) {
			return e.clientHeight
		}
		return 0
	}
 
	function y() {
		if (window.pageYOffset) {
			return window.pageYOffset
		}
		return Math.max(document.documentElement.scrollTop, document.body.scrollTop)
	}
 
	function E(e) {
		var t = m(e);
		return t >= w && t <= b + w
	}
 
	function S() {
		var e = document.createElement("audio");
		e.setAttribute("class", l);
		e.src = i;
		e.loop = false;
		e.addEventListener("canplay", function() {
			setTimeout(function() {
				x(k)
			}, 500);
			setTimeout(function() {
				N();
				p();
				for (var e = 0; e < O.length; e++) {
					T(O[e])
				}
			}, 15500)
		}, true);
		e.addEventListener("ended", function() {
			N();
			h()
		}, true);
		e.innerHTML = " <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>";
		document.body.appendChild(e);
		e.play()
	}
 
	function x(e) {
		e.className += " " + s + " " + o
	}
 
	function T(e) {
		e.className += " " + s + " " + u[Math.floor(Math.random() * u.length)]
	}
 
	function N() {
		var e = document.getElementsByClassName(s);
		var t = new RegExp("\\b" + s + "\\b");
		for (var n = 0; n < e.length; ) {
			e[n].className = e[n].className.replace(t, "")
		}
	}
 
	var e = 30;
	var t = 30;
	var n = 350;
	var r = 350;
	var i = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";
	var s = "mw-harlem_shake_me";
	var o = "im_first";
	var u = ["im_drunk", "im_baked", "im_trippin", "im_blown"];
	var a = "mw-strobe_light";
	var f = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";
	var l = "mw_added_css";
	var b = g();
	var w = y();
	var C = document.getElementsByTagName("*");
	var k = null;
	for (var L = 0; L < C.length; L++) {
		var A = C[L];
		if (v(A)) {
			if (E(A)) {
				k = A;
				break
			}
		}
	}
	if (A === null) {
		console.warn("Could not find a node of the right size. Please try a different page.");
		return
	}
	c();
	S();
	var O = [];
	for (var L = 0; L < C.length; L++) {
		var A = C[L];
		if (v(A)) {
			O.push(A)
		}
	}
})()    '>High一下</a> </li>

  </ul>
  <div class="clearfix"></div>
</nav>
<div class="clearfix"></div></header>
  <div id="content" class="inner">
    <div id="main-col" class="alignleft"><div id="wrapper">
  <article class="post">
  
    <div class="gallery">
  <div class="photoset">
    
      <img src="">
    
  </div>
  <div class="control">
    <div class="prev"></div>
    <div class="next"></div>
  </div>
</div>
  
  <div class="post-content">
    <header>
      
        <div class="icon"></div>
        <time datetime="2014-04-08T21:25:00.000Z"><a href="/2014/04/73/">2014-04-09</a></time>
      
      
  
    <h1 class="title"><a href="/2014/04/73/">给trac的ticket添加提交时字段验证</a></h1>
  

    </header>
    <div class="entry">
      
        <p>我们在项目管理中使用了trac系统，并且对于ticket添加了以下自定义字段并且对它们的格式都有一定要求：</p>
<ul>
<li>svn版本号：格式为 r1234。多个版本号之间使用半角逗号隔开。如：r1234,r5678</li>
<li>完成日期：yyyy-mm-dd的格式</li>
<li>开发周期：表示开发功能所耗费的时间，格式为数字或者一位小数后面跟上单位h或者d。</li>
<li>测试版本号：v开头的标准版本号，如：v2.3.1.5098<br>但是在实际操作中，很多开发人员不去阅读规范文档或者压根记不起来格式规范，随意填写，很是苦恼。</li>
</ul>
<p>今天就先试图给完成日期添加一个<a href="http://trac-hacks.org/wiki/DateFieldPlugin">日期插件</a>让开发人员直接使用日期对话框来选择日期，同时发现它已经自带了格式验证，然后在寻找这个插件的同时发现了一个好用的格式验证插件<a href="https://trac-hacks.org/wiki/TracTicketValidatorPlugin">https://trac-hacks.org/wiki/TracTicketValidatorPlugin</a>。</p>
<p>如何安装此插件就不在这里描述，直奔主题看看如何实现配置trac使插件生效。<br>
      
    </div>
    <footer>
      
        
          <div class="alignleft">
            <a href="/2014/04/73/#more" class="more-link">阅读全文</a>
          </div>
        
        
      
      <div class="clearfix"></div>
    </footer>
  </div>
</article>




  <article class="post">
  
    <div class="gallery">
  <div class="photoset">
    
      <img src="">
    
  </div>
  <div class="control">
    <div class="prev"></div>
    <div class="next"></div>
  </div>
</div>
  
  <div class="post-content">
    <header>
      
        <div class="icon"></div>
        <time datetime="2014-03-07T21:51:52.000Z"><a href="/2014/03/69/">2014-03-08</a></time>
      
      
  
    <h1 class="title"><a href="/2014/03/69/">使用__declspec(dllimport)与否的区别</a></h1>
  

    </header>
    <div class="entry">
      
        <p>按照MSDN说明，当链接dll的导出函数时，只需要包含头文件和lib，__declspec(dllimport)修饰符不是必须的，但加上该修饰能使导出函数的调用效率更高。那么，究竟原因是什么？</p>
<p><strong><em>不使用 <strong>declspec(dllimport) 也能正确编译代码，但使用 </strong>declspec(dllimport) 使编译器可以生成更好的代码。编译器之所以能够生成更好的代码，是因为它可以确定函数是否存在于 DLL 中，这使得编译器可以生成跳过间接寻址级别的代码，而这些代码通常会出现在跨 DLL 边界的函数调用中。但是，必须使用 __declspec(dllimport) 才能导入 DLL 中使用的变量。</em> &nbsp;</strong><br>
      
    </div>
    <footer>
      
        
          <div class="alignleft">
            <a href="/2014/03/69/#more" class="more-link">阅读全文</a>
          </div>
        
        
      
      <div class="clearfix"></div>
    </footer>
  </div>
</article>




  <article class="post">
  
    <div class="gallery">
  <div class="photoset">
    
      <img src="">
    
  </div>
  <div class="control">
    <div class="prev"></div>
    <div class="next"></div>
  </div>
</div>
  
  <div class="post-content">
    <header>
      
        <div class="icon"></div>
        <time datetime="2013-11-11T19:40:58.000Z"><a href="/2013/11/67/">2013-11-12</a></time>
      
      
  
    <h1 class="title"><a href="/2013/11/67/">vs的几种调试方法</a></h1>
  

    </header>
    <div class="entry">
      
        <p>作者：zhaohaiyang_1988@163.com (转载需保留)</p>
<p>========================================================================================</p>
<h1 id="进入调试的方法"><a href="#进入调试的方法" class="headerlink" title="进入调试的方法"></a>进入调试的方法</h1><p>1. F5，项目右键菜单-&gt;调试-&gt;启用新实例<br>    点击项目右键菜单-&gt;属性-&gt;配置属性-&gt;调试，可以设置调试的相关参数：<br>      1、命令：默认是$(TargetPath)，就是启动输出的可执行程序<br>      2、命令参数：启动被调试程序时使用的命令行参数。<br>      3、工作目录：启动被调试程序时使用的当前文件夹。影响GetCurrentDir,以及加载dll。<br>      4、附加：否-启动新进程 是-附加到已经存在的进程中<br>      其它参数不常用，有兴趣请百度之。<br>
      
    </div>
    <footer>
      
        
          <div class="alignleft">
            <a href="/2013/11/67/#more" class="more-link">阅读全文</a>
          </div>
        
        
      
      <div class="clearfix"></div>
    </footer>
  </div>
</article>




  <article class="post">
  
    <div class="gallery">
  <div class="photoset">
    
      <img src="">
    
  </div>
  <div class="control">
    <div class="prev"></div>
    <div class="next"></div>
  </div>
</div>
  
  <div class="post-content">
    <header>
      
        <div class="icon"></div>
        <time datetime="2013-04-28T02:32:29.000Z"><a href="/2013/04/63/">2013-04-28</a></time>
      
      
  
    <h1 class="title"><a href="/2013/04/63/">win7下清除带有稀疏块的文件的稀疏属性时导致文件损坏</a></h1>
  

    </header>
    <div class="entry">
      
        <p>众所周之，使用下面的代码可以设置文件为稀疏文件。<br>::DeviceIoControl(file, FSCTL_SET_SPARSE, 0, 0, 0, 0, &amp;temp, 0);</p>
<p>使用这段代码清除稀疏文件标志(vista及以后才有效)<br>DWORD temp;<br>FILE_SET_SPARSE_BUFFER b;<br>b.SetSparse = FALSE;<br>::DeviceIoControl(file, FSCTL_SET_SPARSE, &amp;b, sizeof(b), 0, 0, &amp;temp, 0));</p>
<p>但，
      
    </div>
    <footer>
      
        
          <div class="alignleft">
            <a href="/2013/04/63/#more" class="more-link">阅读全文</a>
          </div>
        
        
      
      <div class="clearfix"></div>
    </footer>
  </div>
</article>




  <article class="post">
  
    <div class="gallery">
  <div class="photoset">
    
      <img src="">
    
  </div>
  <div class="control">
    <div class="prev"></div>
    <div class="next"></div>
  </div>
</div>
  
  <div class="post-content">
    <header>
      
        <div class="icon"></div>
        <time datetime="2013-03-18T23:38:45.000Z"><a href="/2013/03/58/">2013-03-19</a></time>
      
      
  
    <h1 class="title"><a href="/2013/03/58/">微软数字签名和长度和位移</a></h1>
  

    </header>
    <div class="entry">
      
        <p>原来微软数字签名的内容是直接追加在文件末尾的，这导致了原来的根据PE头的Sections的最后一个段的位移和大小确定文件末尾的方法对于有签名的程序不适用。还好，有OptionHeader中的结构可以获取数字签名的长度。<br>ntHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] </p>

      
    </div>
    <footer>
      
        
        
      
      <div class="clearfix"></div>
    </footer>
  </div>
</article>




  <article class="post">
  
    <div class="gallery">
  <div class="photoset">
    
      <img src="">
    
  </div>
  <div class="control">
    <div class="prev"></div>
    <div class="next"></div>
  </div>
</div>
  
  <div class="post-content">
    <header>
      
        <div class="icon"></div>
        <time datetime="2013-02-16T01:03:49.000Z"><a href="/2013/02/59/">2013-02-16</a></time>
      
      
  
    <h1 class="title"><a href="/2013/02/59/">C++静态库中使用_declspec(dllexport) 不能导出函数的问题</a></h1>
  

    </header>
    <div class="entry">
      
        <p>在某项目中，有一些静态库，这些静态库中有类型命名的函数GET_XXX。在一次项目结构调整的时候，我想将调用这静态库的代码编译成DLL，并且将这些Get函数导出，我就直接就这些函数前面添加了_declspec(dllexport)，</p>
<p>然后代码结构就成为：</p>
<p>静态库A: 包括很多 _declspec(dllexport) GET_XXX 函数。<br>
      
    </div>
    <footer>
      
        
          <div class="alignleft">
            <a href="/2013/02/59/#more" class="more-link">阅读全文</a>
          </div>
        
        
      
      <div class="clearfix"></div>
    </footer>
  </div>
</article>





<nav id="pagination">
  
    <a href="/page/3/" class="alignleft prev">上一页</a>
  
  
    <a href="/page/5/" class="alignright next">下一页</a>
  
  <div class="clearfix"></div>
</nav></div></div>
    <aside id="sidebar" class="alignright">
  <div class="search">
  <form action="//google.com/search" method="get" accept-charset="utf-8">
    <input type="search" name="q" results="0" placeholder="搜索">
    <input type="hidden" name="q" value="site:baba.zhaoxiuyuan.com">
  </form>
</div>

  
<div class="widget tag">
  <h3 class="title">分类</h3>
  <ul class="entry">
  
    <li><a href="/categories/C/">C++</a><small>4</small></li>
  
    <li><a href="/categories/net/P2P/">P2P</a><small>2</small></li>
  
    <li><a href="/categories/WEB/">WEB</a><small>1</small></li>
  
    <li><a href="/categories/WINDOWS编程/">WINDOWS编程</a><small>6</small></li>
  
    <li><a href="/categories/bugs/">bugs</a><small>2</small></li>
  
    <li><a href="/categories/ie/flash/">flash</a><small>1</small></li>
  
    <li><a href="/categories/ie/">ie</a><small>1</small></li>
  
    <li><a href="/categories/java/">java</a><small>5</small></li>
  
    <li><a href="/categories/java/minecraft/">minecraft</a><small>2</small></li>
  
    <li><a href="/categories/net/">net</a><small>2</small></li>
  
    <li><a href="/categories/python/">python</a><small>1</small></li>
  
    <li><a href="/categories/windows/">windows</a><small>2</small></li>
  
    <li><a href="/categories/bugs/windows/">windows</a><small>1</small></li>
  
    <li><a href="/categories/工具/">工具</a><small>1</small></li>
  
    <li><a href="/categories/开源项目/">开源项目</a><small>2</small></li>
  
    <li><a href="/categories/未分类/">未分类</a><small>0</small></li>
  
    <li><a href="/categories/系统-工具/">系统/工具</a><small>7</small></li>
  
    <li><a href="/categories/软件/">软件</a><small>2</small></li>
  
  </ul>
</div>


  <div class="widget tag">
<h3 class="title">简介</h3>
<ul class="entry">
<li>本体：赵海洋</li>
<li>二次元：k1988 | 赵大海</li>
<li>现状：大蓝鲸某IT公司研发部经理</li>
<li>QQ 号：1811132352</li>
<li>早期博客：<a href="http://blog.csdn.net/k1988/">CSDN博客</a></li>
</ul>
</div>



  <iframe width="100%" height="550" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=550&fansRow=2&ptype=1&speed=0&skin=1&isTitle=1&noborder=1&isWeibo=1&isFans=1&uid=1196349092&verifier=d3636f5c&dpc=1"></iframe>
</aside>
    <div class="clearfix"></div>
  </div>
  <footer id="footer" class="inner"><section>
Theme of <a href="https://github.com/k1988/lightum">Lightum</a>, Improved from <a href="https://github.com/hexojs/hexo-theme-light">Light</a>, by <a href="/">k1988</a> 
<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">本站总访问量<span id="busuanzi_value_site_pv"></span>次</span>
</section>
<div class="clearfix"></div>
</footer>
  <script src="//libs.baidu.com/jquery/2.0.3/jquery.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>




<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
(function($){
  $('.fancybox').fancybox();
})(jQuery);
</script>


<!-- mathjax config similar to math.stackexchange -->

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      processEscapes: true
    }
  });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
</script>

<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</body>
</html>


<a href="https://github.com/k1988" target="_blank"><img style="position: absolute; top: 0; left: 0; border: 0;" src="/imgs/forkme_left_green_007200.png" alt="Fork me on GitHub"></a>
